package com.snowy.demo.log.event;

import com.snowy.demo.log.pullEvent.SysLogPullEvent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.event.EventListener;
import org.springframework.core.annotation.Order;
import org.springframework.scheduling.annotation.Async;

/**
 * @program: xsnow
 * @description: 系统日志事件 监听器
 * 1.异步执行
 * @author: li.chen
 * @create: 2018-06-06 10:09
 **/
@Slf4j
public class SysLogListener {
    @Autowired
    private  SysLogPullEvent sysLogPullEvent;
    @Async
    @Order
    @EventListener(SysLogEvent.class)
    public void saveSysLog(SysLogEvent event) {
        log.debug(".....异步保存日志....:");
        sysLogPullEvent.SysLogPullSystem(event);
    }
}
